# -*- coding:utf-8 -*-
'''
管理配置参数,比如mysql路径,redis端口
'''
import redis


class Config(object):
    DEBUG = False

    '''-----数据库相关配置-----'''
    # 配置数据库
    SQLALCHEMY_DATABASE_URI = 'mysql://root:mysql@127.0.0.1/ihome06'
    # 只是为了去除警报,无实际的意义
    SQLALCHEMY_TRACK_MODIFICATIONS = False

    SECRET_KEY = 'itheima'

    REDIS_PORT = '6379'
    REDIS_HOST = '127.0.0.1'

    # 配置Flask-Session信息
    SESSION_TYPE = 'redis'
    SESSION_USE_SIGNER = True

    # 扩展默认会有redis的地址信息(127.0.0.1 6379),以及前缀信息
    SESSION_REDIS = redis.StrictRedis(port=REDIS_PORT, host=REDIS_HOST)
    PERMANENT_SESSION_LIFETIME = 86400 * 2  # SESSION 生命周期


class DevelopmentConfig(Config):
    DEBUG = True


class ProductionConfig(Config):
    pass
